DB013 arrayForth 3 User's Manual
2.1.2 Layering of arrayForth
A principal design goal of arrayForth is that in both environments there shall be a resident F18 assembler with the full
ability to build instructions and reference labels defined in object code bins. Our experience has been that forcing
programmers to write F18 instructions, or addresses in F18 routines, as hexadecimal literals in their application code is
not merely an impediment to documentation. It has also, even in software released by GreenArrays, proven to embed
un-auditable future bugs in that software. Hence, with arrayForth, we return to fully symbolic representation of code.
This has, after all, proven over the last half century to be a very effective way of protecting oneself from many
programmer traps. The problem with writing a simple number like "5" is that without context the meaning of that
number is not evident, and that meaning can only be determined by holographic recollection or sometimes exhaustive
study of the code. Most of us learned early in life that our ability at recollection is anything but holographic.
However, in a 16-bit machine a single compiled block of high level source can consume a substantial fraction of the
available address space, and having decided to make that block resident the scope of what can be done with what is
left of the machine is diminished. Many of us have not lived in such a resource-constrained world for forty years or so,
and we've found the habits that requires have faded. Because environmental conventions are painful to change after
one has started building things respecting them, we have tried to make the best decisions we could in factoring and
layering arrayForth. Of course, in any undertaking of that sort one will inevitably make mistakes. The conventions
underlying arrayForth can, and will, be changed if we find serious design flaws. Such changes will be documented.
2.1.2.1 AFORTH Capsule
This is a resident CAPSULE. It is accessed by interpreting its name, AFORTH. (Immediately after HI the word AFORTH
means to build that capsule by loading its resident code, and redefining the word AFORTH as a CAPSULE. Thus the
code does not exist until you need it.)
You must be running in the AFORTH capsule to have access to any of its capabilities. The code that is physically
resident on both platforms is the F18 Assembler, configuration data, and at least the names of all the other tools
provided by arrayForth. At present, none of these tools are resident on either system. The reason for this is that we
cannot countenance making anything beyond the F18 Assembler resident in the pF/144 environment, and we believe
that requiring different steps and procedures on each platform to accomplish things supported on both would be a
very bad thing.The vocabulary provided with AFORTH on each system is specifically documented in later sections.
2.1.3 Caveats
Along with many similarities, there are significant environmental differences between the two platforms. One
immediately visible difference is that the size of the basic integer and address data in sF/x86 is 32 bits while on pF/144
it is 16 bits. Another is that all addresses in sF/x86 are byte addresses while on pF/144 there are both byte and cell
addresses. Further, and most significantly for programming purposes, the resources of the GA144 hardware are
limited (basic addressing covers 64 kWords or 64 kBytes in the EVB002, with a maximum extended memory of 2
Mbytes, onboard mass storage of 16 Mbytes, and the relatively low performance of a virtual machine implementation;
whereas the sF environment has effectively gigabytes of memory, orders of magnitude more mass storage, and the
performance of a dedicated x86 processor for running the high level language.
However, in the context of arrayForth, you will not be using saneFORTH to write x86 code but rather to run our tools
for programming the GA144 chips. Therefore, from your perspective, the main differences will lie in resources and
performance, with the resulting differences in which tools we have chosen to implement for each platform.
Another thing which comes as a surprise to newcomers first working with Forth systems is that, in the basic Interpreter
context, every word and function compiled in the system is accessible from your keyboard. Indiscriminate typing of
words whose meanings you do not understand and are not employing correctly can lead to surprising results!
Moreover, again without specific contextual modifications to prevent such, you have full power to crash the system if
you wish. On machines without memory protection hardware, you merely need say something like 0 10000 ERASE
and in most cases you won't get an answer to that statement. So, before hitting ENTER, make sure what you typed is
what you meant to say!
Copyright© 2010-2017 GreenArrays, Inc. 11/12/22
10